import Home from '@/pages/Home'
import Login from '@/pages/Login'
import Search from '@/pages/Search'
import Register from '@/pages/Register'
import Detail from '@/pages/Detail'
import AddCartSuccess from '@/pages/AddCartSuccess'
import ShopCart from '@/pages/ShopCart'
export default [{
        path: '/home',
        component: Home,
        meta: { show: true }
    },
    {
        path: '/login',
        component: Login,
        meta: { show: false }
    },
    {
        name: 'search',
        path: '/search/:keyword?', //?可传可不传
        component: Search,
        meta: { show: true },
        // props: true
        // props: ($route) => {
        //     return {
        //         keyWords: $route.params.keyWords,
        //         k: $route.query.k
        //     }
        // }
    },
    {
        path: '/register',
        component: Register,
        meta: { show: false }
    }, {
        path: '/detail/:skuid',
        component: Detail,
        meta: { show: true }
    }, {
        name: 'addcartsuccess',
        path: '/addcartsuccess',
        component: AddCartSuccess,
        meta: { show: true }
    }, {
        name: 'shopcart',
        path: '/shopcart',
        component: ShopCart,
        meta: { show: true }
    },
    {
        path: '*',
        redirect: '/home'
    }
]